package com.jxd.ordersys.controller;

import com.jxd.ordersys.model.OrderReview;
import com.jxd.ordersys.service.IOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName OrderReviewController
 * @Description TODO
 * @Author 王云超
 * @Date 2024/9/21 15:14
 * @Version 1.0
 */
@RestController
public class OrderReviewController {
    @Autowired
    IOrdersService ordersService;

    // 批量审核
    @RequestMapping("/reviewOrder")
    public String reviewOrders(@RequestBody Map<String, Object> reviewData) {
        Integer orderId = (Integer) reviewData.get("orderId");
        String reviewerName = (String) reviewData.get("reviewerName");
        String reviewNote = (String) reviewData.get("reviewNote");
        Integer reviewResult = (Integer) reviewData.get("reviewResult");
        // 调用服务层处理
        ordersService.reviewOrder(orderId, reviewerName, reviewNote, reviewResult);
        return "success";
    }
}